package cj.web.portal.dao;

import java.util.List;
import java.util.Map;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;

@DAO
public interface PaperDAO {
	
	@SQL("SELECT id,title,category,abstractInfor,carouselImage,content,author,releaseState,date_format(releaseAT,'%Y-%m-%d %H:%i:%s') as releaseAT,orderNo,source,qrCode,stickAT,deleteFlag,createUser,date_format(createAT,'%Y-%m-%d %H:%i:%s') as createAT,updateUser,date_format(updateAT,'%Y-%m-%d %H:%i:%s') as updateAT FROM Contant WHERE deleteFlag=1 and releaseState=1 and category=:1 order by updateAT desc limit :2,:3")
	List<Map> query(int paperCategory, int start, int length );
	
	@SQL("SELECT id,title,category,abstractInfor,carouselImage,content,author,releaseState,date_format(releaseAT,'%Y-%m-%d %H:%i:%s') as releaseAT,orderNo,source,qrCode,stickAT,deleteFlag,createUser,date_format(createAT,'%Y-%m-%d %H:%i:%s') as createAT,updateUser,date_format(updateAT,'%Y-%m-%d %H:%i:%s') as updateAT FROM Contant WHERE deleteFlag=1 and releaseState=1 and id=:1")
	List<Map> queryById(String id);

}
